	
	package service;

	import java.util.ArrayList;
	import java.util.List;
	import enitys.Course;
	import Dao.CouserDao;
	import Dao.daoimpl.CourseDaoImpl;
		
	public class CourseManager {
		
		private CouserDao dao = new CourseDaoImpl();
		static private CourseManager instance = null;
	
		private CourseManager() {
	
		}
	
		static public synchronized CourseManager getInstance() 
		{
				if (instance == null) {
					instance = new CourseManager();
				}
				return instance;
		}
		public List<Course> courseAllInfo() throws Exception 
		{
				List<Course> list = new ArrayList<Course>();
				list=dao.courseallinfo();
				return list;
			
		}
		public List<Course> findCourseInfoById(int id){
			
			return dao.findCourseInfoById(id);
			
		}
		public boolean AddCourse(Course course){
			return dao.AddCourseInfo(course);
		}
		public boolean modifcourseinfo(Course course) throws Exception 
		{
				return	dao.modifCourseinfo(course);
			
		}
		public int deletecourseinfo(int course) throws Exception
		{
				return dao.deleteCourseinfo(course);
		}
	
	}
